Skip to content

Add integer check for alphabet size#2458

Open
heapframe wants to merge 4 commits into
gchq:masterfrom
heapframe:patch-1
Open

Add integer check for alphabet size#2458
heapframe wants to merge 4 commits into
gchq:masterfrom
heapframe:patch-1

Conversation

@heapframe
Copy link
Copy Markdown

@heapframe heapframe commented May 27, 2026

Fixes "Generate De Bruijn Sequence - RangeError in blob:null/6895a5cc-cf19-4023-b300-36e358dad354 on line 2.<br><br>Message: invalid array length"

Description
Adds a check for "Alphabet Size" to make sure its an integer and not a float

Existing Issue
#2450

AI disclosure
I did not use any AI tools.

Test Coverage
Before:
image
After:
image

Fixes "Generate De Bruijn Sequence - RangeError in blob:null/6895a5cc-cf19-4023-b300-36e358dad354 on line 2.<br><br>Message: invalid array length"
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 27, 2026

CLA assistant check
All committers have signed the CLA.

Comment on lines +53 to +56
if (!Number.isInteger(k)) {
throw new OperationError("Invalid alphabet size, required to be integer.");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a similar test / error for n not being an integer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants